package com.yanqu.road.server.cmd.specialcookboy;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.specialcookboy.SpecialCookBoyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.specialcookboy.SpecialCookBoyMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_SPECIAL_COOK_BOY_GET_AND_UPDATE_SHARE_CODE, desc = "小当家特色服获取并更新分享码")
public class SpecialCookBoyGetNewestShareCodeCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        SpecialCookBoyProto.SpecialCookBoyUpdateShareCodeResp.Builder newestShareCode = SpecialCookBoyMgr.getNewestShareCode(player.getUserId());
        player.sendPacket(ClientProtocol.U_SPECIAL_COOK_BOY_GET_AND_UPDATE_SHARE_CODE, newestShareCode);

    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
